package gui;

import java.util.ArrayList;
import java.util.List;

import model.SparePart;
import model.compare.CompareByUniqueID;
import service.QuickSort.QuickSortSparePartBy;

public class SearchTest {

	public static void main(String[] args) {

		List<SparePart> sps = new ArrayList<SparePart>();

		SparePart sp1 = new SparePart(1111111, 111, 111, 000, "sp1-ring26",
				123, 120, 25, "for GS20");
		SparePart sp2 = new SparePart(2202334, 331, 311, 321, "sp2-", 30, 32,
				7, "for GS32");
		SparePart sp3 = new SparePart(1111113, 111, 113, 000, "sp3-ring28", 41,
				32, 180, "for GS20");
		SparePart sp4 = new SparePart(1111114, 111, 114, 000, "sp4-ring29", 63,
				50, 5, "for GS20");
		SparePart sp5 = new SparePart(1111115, 111, 115, 000, "sp5-transistor",
				20, 16, 90, "for GS20");
		SparePart sp6 = new SparePart(2203459, 331, 311, 321, "sp6-Sp", 30, 32,
				7, "for GS20");
		sps.add(sp1);
		sps.add(sp2);
		sps.add(sp3);
		sps.add(sp4);
		sps.add(sp5);
		sps.add(sp6);
		// ----------------------------
		long target = 1111314;
		// ----------------------------
		
		
		
		Search s = new Search();
		new QuickSortSparePartBy(sps, new CompareByUniqueID());
		System.out.println("Searching Restult for " + target + ": "
				+ s.binarySearchByNumber(sps, target));
		System.out.println("DAO-Searching Restult for " + target + ": "
				+ s.getSparePartByUniqueID(target));
	}
}
